/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package datos;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author pablo
 */
public class ConjuntosDB {
       public ResultSet buscadorconjuntoNombre(String nombre,int op,int order) throws SQLException {
        OperacionesBase db = new OperacionesBase();
        String query;
        if(op==1)
           query = "SELECT * from buscador_conjunto( '" + nombre + "'," + 1 + "," + 0 + ") as (nombreconjunto character varying, nombreVesturaio character varying,clase character varying,fecha character varying ,fkk date);";
        else if(order ==1)
           query = "SELECT * from buscador_conjunto( '" + nombre + "'," + 2 + "," + 1 + ") as (nombreconjunto character varying, nombreVesturaio character varying,clase character varying,fecha character varying ,fkk date);";
        else if(order==2)   
            query = "SELECT * from buscador_conjunto( '" + nombre + "'," + 2 + "," + 2 + ") as ( conjunto character varying,vestuario character varying,clase character varying,numerouso integer );";
         else if(order==3)   
            query = "SELECT * from buscador_conjunto( '" + nombre + "'," + 2 + "," + 3 + ") as ( conjunto character varying,vestuario character varying,fotovestuario character varying,fotocategoria character varying,calificacion integer);";
         else if(order==4)   
            query = "SELECT * from buscador_conjunto( '" + nombre + "'," + 2+ "," + 4+ ") as (nombreconjunto character varying, nombreVesturaio character varying,clase character varying,fecha character varying ,fkk date);";
         else if(order==5)   
            query = "SELECT * from buscador_conjunto( '" + nombre + "'," +2 + "," + 5+ ")  as ( conjunto character varying,vestuario character varying,clase character varying,numerouso integer );";
        else
            query = "SELECT * from buscador_conjunto( '" + nombre + "'," + 2 + "," + 6 + ") as ( conjunto character varying,vestuario character varying,fotovestuario character varying,fotocategoria character varying,calificacion integer);";
        
        ResultSet resultado = db.seleccion(query);

        return resultado;
    }
}
